package ch.zbw.iCoach.Dameon;
/**
 * This class is a main part of the play modus. At the moment of playing it stores all information from an active user
 *  and hold an LanguageList reference.
 *  
 *  This class extend to an "User" class. 
 * 
 * @author Dameon Crane
 * @version Version 1 (release 18.03.2013)
 */
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

import ch.zbw.iCoach.remo.User;
import ch.zbw.iCoach.remo.UserList;

public class LanguageList {
	/**
	* The constructor initialises the language array from the Class Language. 
	* 
	* @param languageList    	parameter for the language array
	*/
    private static ArrayList <Language> languageList;
    
    
    public LanguageList (){
    	
    	this.languageList = new ArrayList<Language>();
    }
	/**
	* This method creates a new language in the language array
	* 
	*/
    
    public void createLanguage (Language language)
    {
        this.languageList.add(language);
    }
	/**
	* This method creates a new language in the language array
	* 
	*/
    
    public boolean addLanguage (Language lang){
		return this.languageList.add(lang);
		
	}
	/**
	* This method deletes a language in the language array
	* 
	*/	
	public void deleteLanguage (int index){
		
		this.languageList.remove(index);
	}

	
	/**
	* This method retrieves the langID from the array
	* 
	*/
	public Language getlang(int index){
		int tempindex = index; 
		System.out.println("Array size: " + this.languageList.size());
		System.out.println("Array looking index: " + index);
		return this.languageList.get(index);
	}
	
	/**
	* This method retrieves the size language array
	* 
	*/
	public int getSize(){
		return this.languageList.size();
	}
	/**
	* This method clears language array
	* 
	*/
	public void clearAllData()
	{
		languageList.clear();
	}
	
	/**
	* This is a help method used during testing
	*/
	public void printLang()
	{
		for( int i = 0; i< languageList.size(); i++)
			System.out.println( Arrays.asList(languageList));
	}

}


